package com.open4cn.simulator.core.ext;

import com.open4cn.simulator.core.exception.IllegalParameterException;

/**
 * @author yinxiaopeng
 * @version 1.0.0
 * @company 致景科技
 * @department 飞梭BU/研发
 * @description
 * @Email yinxiaopeng@zj.tech
 * @date 2022-05-19 21:35
 */
public enum DeviceEnum {
    DATA_COLOR_600("datacolor/600", "DC600"),
    DATA_COLOR_800("datacolor/800", "DC800"),
    DATA_COLOR_1000("datacolor/1000", "DC1000"),
    HUA_GAO_9000("huagao/9000", "华高9000"),
    XRITE_7000("xrite/7000", "爱色丽7000"),
    XRITE_7800("xrite/7800", "爱色丽7800"),
    ;


    DeviceEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DeviceEnum of(String code) {
        if (null != code) {
            for (DeviceEnum item : values()) {
                if (item.code.equalsIgnoreCase(code)) {
                    return item;
                }
            }
        }
        throw new IllegalParameterException();
    }
}